/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};
  config.io = {
    init: {}, // passed to engine.io
    namespace: {
      '/': {
        connectionMiddleware: ['auth'],
        packetMiddleware: ['packet'],
      },
    },
  };
  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1660525511146_7232';

  // add your middleware config here
  config.middleware = [];
  config.session = {
    key: 'keys_value',
    maxAge: 24 * 3600 * 1000, // 1 天
    httpOnly: true,
    encrypt: true,
  };
  config.mysql = {
    client: {
      // host
      host: 'localhost',
      // 端口号
      port: '3306',
      // 用户名
      user: 'root',
      // 密码
      password: 'root',
      // 数据库名
      database: 'wryxll',
    },
    // 是否加载到 app 上，默认开启
    app: true,
    // 是否加载到 agent 上，默认关闭
    agent: false,
  }
  config.security = {
    csrf: {
      enable: false
    }
  }
  config.cors = {
    origin: '*',
  }
  config.jwt = {
    secret: "12wu12sdnssA8291"
  }
  config.cluster = {
    listen: {
      path: '',
      port: 7001,
      hostname: '192.168.2.6',
    }
  };

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};

// {app_root}/config/config.${env}.js

